Skip to content

feat!: a static context propagates staticness to nested calls, even those that are not static calls.#16670

Merged
dbanks12 merged 1 commit intonextfrom
db/propagate-staticness
Sep 2, 2025
Merged

feat!: a static context propagates staticness to nested calls, even those that are not static calls.#16670
dbanks12 merged 1 commit intonextfrom
db/propagate-staticness

Conversation

@dbanks12
Copy link
Copy Markdown
Contributor

@dbanks12 dbanks12 commented Aug 29, 2025

Small constraints change along with some new tests.

Copy link
Copy Markdown
Contributor

@jeanmon jeanmon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great little PR with good testing!
Please look at my feedback before merging.

Comment thread barretenberg/cpp/pil/vm2/context.pil Outdated
Comment thread barretenberg/cpp/pil/vm2/context.pil Outdated
Comment thread barretenberg/cpp/pil/vm2/context.pil
EXPECT_THROW_WITH_MESSAGE(check_relation<context>(trace, context::SR_IS_STATIC_IF_STATIC_CALL),
"IS_STATIC_IF_STATIC_CALL");

// reset is_static
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover? Not needed if this is the end of the test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to always "reset" mutated things like this in our cpp tests. Sometimes I do a few of them back-to-back. So this is just me trying to be consistent.

EXPECT_THROW_WITH_MESSAGE(check_relation<context>(trace, context::SR_IS_STATIC_IF_STATIC_CALL),
"IS_STATIC_IF_STATIC_CALL");

// reset is_static
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

EXPECT_THROW_WITH_MESSAGE(check_relation<context>(trace, context::SR_IS_STATIC_IF_CALL_FROM_STATIC_CONTEXT),
"IS_STATIC_IF_CALL_FROM_STATIC_CONTEXT");

// reset is_static
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

EXPECT_THROW_WITH_MESSAGE(check_relation<context>(trace, context::SR_IS_STATIC_NEXT_ROW), "IS_STATIC_NEXT_ROW");

// reset is_static
trace.set(C::execution_is_static, 2, 1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Comment thread barretenberg/cpp/src/barretenberg/vm2/constraining/relations/context.test.cpp Outdated
@dbanks12 dbanks12 force-pushed the db/propagate-staticness branch from e446a77 to faec221 Compare September 1, 2025 17:53
@dbanks12 dbanks12 force-pushed the db/propagate-staticness branch 2 times, most recently from 01070a1 to d728809 Compare September 1, 2025 18:11
@dbanks12 dbanks12 force-pushed the db/propagate-staticness branch from d728809 to 206d423 Compare September 1, 2025 19:36
@dbanks12 dbanks12 force-pushed the db/propagate-staticness branch from 206d423 to e227523 Compare September 1, 2025 23:51
Base automatically changed from db/test-updates to next September 2, 2025 00:55
@dbanks12 dbanks12 added this pull request to the merge queue Sep 2, 2025
Merged via the queue into next with commit 86b24e3 Sep 2, 2025
11 of 12 checks passed
@dbanks12 dbanks12 deleted the db/propagate-staticness branch September 2, 2025 01:44
ludamad pushed a commit that referenced this pull request Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants